<template>
  <div class="filterContainer">
    <div class="filterContent">
      <mu-list>
        <template v-for="(value, index) in sortList">
          <mu-list-item
            :title="value.text"
            :key="index"
            :titleClass="{activeTitle: activeIndex == index}"
            @click="selOk(value, index)"
          ></mu-list-item>
          <mu-divider :key="index" />
        </template>
      </mu-list>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      sortList: [
        { text: "综合排序", id: 1 },
        { text: "接诊量", id: 2 },
        { text: "患者评价", id: 3 },
      ],
      activeIndex: 0,
      selSortType: { text: "综合排序", id: 1 }
    };
  },
  mounted() {},
  methods: {
    selOk(value, index) {
      this.selSortType = value;
      this.activeIndex = index;
      this.$emit("selOk", {
        sortType: value
      });
    }
  }
};
</script>

<style scoped lang="less">
@import "../../common/css/vars";
.filterContainer {
  position: fixed;
  width: 100%;
  top: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  border-top: 1px solid @color-border;
  z-index: 99;
}
.filterContent {
  background-color: white;
  color: black;
}
</style>
<style lang="less">
@import "../../common/css/vars";
.filterContainer .mu-item-title {
  font-size: 14px;
  text-align: center;
}
.activeTitle {
  color: @color-primary;
}
</style>
